package com.lanou.six;

import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

/**
 * 已知数组存放一批QQ号码，QQ号码最长为11位，最短为5位String[] strs = {"12345","67891","12347809933","98765432102","67891",
 * "12347809933"}。将该数组里面的所有qq号都存放在LinkedList中，将list中重复元素删除，将list中所有元素分别用迭代器和增强for循环打印出来
 * @author zyj
 * @date 2022年05月24日 11:37
 */
public class Test {
    public static void main(String[] args) {
        String[] strings ={"12345","67891","12347809933",
                "98765432102","67891","12347809933"};

        List<String> list = new LinkedList<>();
        for (String s:strings) {
            list.add(s);
        }

        List<String> quChong = new LinkedList<>();

        for (String s:strings) {
            if (!quChong.contains(s)){
                quChong.add(s);
            }
        }

        Set<String> quChongSet = new LinkedHashSet<>(list);
    }
}
